Multivariable Functions
Multivariable functions are functions that take multiple inputs and produce a single output.
A single-variable function might look like
Table of Contents
Inputs to Multivariable Functions
The inputs to a function are called the domain of the function. The domain is the set of all possible inputs that the function can take.
This can be extended to multivariable functions. For example, the domain of the function
More formally written, for the function
Outputs of Multivariable Functions
The output of a function is called the range of the function. The range is the set of all possible outputs that the function can produce.
Multivariable functions can output single numbers, but sometimes they can also output vectors, matrices, or other more complex objects.
For example, this function outputs a vector:
Vector-valued functions are typically denoted with a bold letter, an arrow, or both. For example,
This function outputs a matrix:
A function is notated as
Visualizing Multivariable Functions - Scalar-Valued
Multivariable functions can be visuallized in a few different ways. Unlike single-variable functions, graphs might not be sufficiently expressive to capture the behavior of a multivariable function.
Graphing
One way to visualize a multivariable function is to graph it in three dimensions.
In a 2D graph, you have
Conventionally, in a 3D graph, you have
This also shows that, instead of a line of inputs, now you have an entire plane of inputs.
The graph of the function
Instead of having two orthogonal axes, you now have three orthogonal axes. The
Contour Plots
Sometimes it is difficult to visualize a 3D graph. For example, the graph might be difficult to view on a computer screen or in a printed document, or you don't have access to some software that can plot 3D graphs.
One alternative is to use a contour plot. A contour plot is a 2D plot that shows the function's output as a series of contours. A contour plot can be thought of as a top-down view of the 3D graph. Each contour line represents a different output value, and the closer the lines are together, the steeper the function is at that point.
One common example of a contour plot is a topographic map, which shows the elevation of the land as a series of contour lines:
The contour plot of the function
Recall that a contour line is a line where the function has a constant value.
So, for a function
Visualizing Multivariable Functions - Vector-Valued
Some multivariable functions output vectors instead of scalars.
Parametric Equations
Parametric equations take a single input and produce multiple outputs. Usually, you can graph these outputs as a series of points in space.
For example:
This function takes a single input
Let's consider how this function is applied on one point,
We can graph this single point in space:
In order to graph the entire function, we need to consider what range of inputs we want to graph.
For example, if we graph the function for
When visualizing parametric equations, you can think of the input
Consider these two parametric functions:
If we graph these two different functions together, we can see that they trace the same path.
One way to think about this is that the two functions are the same, but one is "ahead" of the other by
To get around this, one way is to label some points on the path with the input value.
Parametric Surfaces
For functions with more dimensions, you can graph them as surfaces in space. For example, consider this function:
This function takes two inputs,
Consider the inputs
For every point in this square, there is a corresponding point in the output 3D space. Doing this for all points in the square gives us a surface, and we can visualize this transformation:
Vector Fields
Another way to visualize vector-valued functions is with vector fields. This works for any function that takes a point in space and outputs a vector.
For example, consider the function
We can place a vector on some points in space, where the vector is the output of the function at that point:
One visual example of a vector field is the flow of water in a river.
Vector fields are often denoted with an uppercase letter with an arrow on top, like
A non-example of a physical quantity as a vector field is a temperature field. While it indeed exists at every point in space, temperature is a scalar quantity, not a vector quantity.
Choosing the Right Visualization
When visualizing multivariable functions, it is important to choose the right visualization for the function.
The main method for choosing the right visualization is to consider the dimensions for both the input and output of the function.
For a function
- If
(more inputs than outputs), you can usually just use a regular graph or a contour plot. - If
(same number of inputs and outputs), you can use a vector field. - If
(more outputs than inputs), you can use a parametric plot/surface.